home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: twisto.eng.hou.compaq.com!news
- From: garyc%cs%contractors@bangate.compaq.com (Gary Clarke)
- Subject: Bit Masking
- Message-ID: <DKz5y4.8En@twisto.eng.hou.compaq.com>
- Sender: news@twisto.eng.hou.compaq.com (System Administrator)
- Organization: Compaq Computer Corp.
- Date: Wed, 10 Jan 1996 17:06:24 GMT
- X-Newsreader: Forte Free Agent 1.0.82
- X-Nntp-Posting-Host: moe.cs.hou.compaq.com
-
- Can someone tell me the elegent way to clear specific bits from a
- byte, e.g.
-
- # define BIT_1 1
- # define BIT_2 2
- # define BIT_3 4
- # define BIT_4 8
-
- Set the bit: x |= BIT_x
-
- Clear the bit using BIT_x: ????
-
- Thankyou, Gary Clarke
-
- GaryC%cs%contractors@bangate.compaq.com
-
-